﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.Users.Dto
@model IPagedList<UserDto>
@{
    Layout = null;
    int i = 0;
    if (Model.Count > 0)
    {
        if (Model.PageNumber != 1)
        {

            i = (Model.PageNumber - 1) * Model.PageSize;
        }
    }
}
<div>

    <table id="t" class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th style="text-align:center;width: 40px;">
                    <div class="i-checks" id="chkDiv">
                        <label class="ibox-tools" id="latd1">
                            <input type="checkbox" id="che" value="">
                        </label>
                    </div>
                </th>
                <th style="width:45px">序号</th>
                <th>账户类型</th>
                <th>登录名</th>
                <th>姓名</th>
                @*<th>邮箱</th>*@
                <th>电话</th>
                @*<th>地址</th>*@
                <th>注册日期</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr>
                    <td class="text-center" colspan="8">暂无用户数据</td>
                </tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    i++;
                    <tr data-value="@item.Id">
                        <td style="text-align:center">
                            <div class="i-checks" data-value="@item.Id">
                                <input type="checkbox" name="che" value="@item.Id"> <i></i>
                            </div>
                        </td>
                        <td>@i</td>
                        <td>@item.EmployeeType</td>
                        <td>@item.UserName</td>
                        <td>@item.Name</td>
                        @*<td>@item.EmailAddress</td>*@
                        @*<td>@item.Mobile</td>*@
                        <td>@item.Mobile</td>
                        <td>@item.CreationTime.ToString("yyyy-M-d")</td>
                    </tr>
                }
            }
        </tbody>
    </table>

</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页
    </div>
    <div class="col-sm-7">
        @Html.PagedListPager(Model, page => Url.Action("Index", new { id = page, keyword = Context.Request.Query["keyword"], factoryid = Context.Request.Query["factoryid"], type = Context.Request.Query["type"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list" }))
    </div>
</div>
